$(function(){
	$(document).on('click','.delete_file',function(){
		//删除页面信息
		
		$(this).parent().remove();
	})
})

function get_fields(tid,id){
	var id = arguments[1]?arguments[1]:0;
	$.post("{fun U('Fields/get_fields')}",{molds:'{$fields_biaoshi}',tid:tid,id:id},function(r){
		$("#ext_fields").html(r);
	});
}
function deleteImage_auto(elm,field){
	$(elm).prev().attr("src", "{__Tpl_style__}/style/images/nopic.jpg");
	$('#'+field).val("");
}

function goleft(a){
	var str = $(a).parent().parent().parent().attr('class');
	var arr = $("."+str+" .upload-icon-img").toArray();
	var index = $('.'+str+' .upload-icon-img').index($(a).closest('.upload-icon-img'));
	var temp;
	if(index-1>=0){
		temp = arr[index];
		arr[index] = arr[index-1];
		arr[index-1] = temp;
		$(a).parent().parent().parent().html(arr)
	}
}
function goright(a){
	var str = $(a).parent().parent().parent().attr('class');
	var arr = $("."+str+" .upload-icon-img").toArray();
	var index = $('.'+str+' .upload-icon-img').index($(a).closest('.upload-icon-img'));
	var temp;
	if(index+1<arr.length){
		temp = arr[index];
		arr[index] = arr[index+1];
		arr[index+1] = temp;
		$(a).parent().parent().parent().html(arr)
	}
}